import request from '@/utils/request'

export function publish(data) {
  return request({
    url: '/teachingResearch/publish',
    method: 'post',
    data
  })
}

export function userFollowIPage(params) {
  return request({
    url: '/user/userFollowIPage',
    method: 'get',
    params
  })
}
//编辑教研
export function teachingResearchUpdate(data) {
  return request({
    url: '/teachingResearch/update',
    method: 'post',
    data: data
  })
}

// 教研详情
export function getTeachingResearchDetail(params) {
  return request({
    url: '/teachingResearch/getTeachingResearchDetail',
    method: 'get',
    params: params
  })
}

// 删除教研
export function delTeachingResearch(params) {
  return request({
    url: `/teachingResearch/delete`,
    method: 'post',
    params: params
  })
}

// 教研列表
export function teachingResearchSearch(data) {
  return request({
    url: '/teachingResearch/search',
    method: 'post',
    data: data
  })
}

// 在线课程列表
export function webCastPage(data) {
  return request({
    url: '/webCast/page',
    method: 'post',
    data: data
  })
}


// 删除在线课程
export function delWebCast(activityId) {
  return request({
    url: `/webCast/delete/${activityId}`,
    method: 'DELETE'
  })
}

// 在线课程详情
export function webCastDetail(activityId) {
  return request({
    url: `/webCast/detail/${activityId}`,
    method: 'get'
  })
}

// 获取在线课程地址
export function webCastUrl(activityId) {
  return request({
    url: `/webCast/getWebCastUrl/${activityId}`,
    method: 'get'
  })
}

// 获取在线课程回放
export function playBack(activityId) {
  return request({
    url: `/webCast/getPlayBack/${activityId}`,
    method: 'get'
  })
}

// 收藏在线课程
export function collectLive(params) {
  return request({
    url: '/webCast/collect',
    method: 'PUT',
    params: params
  })
}

// 取消收藏在线课程
export function cancelCollectLive(params) {
  return request({
    url: '/webCast/cancelCollect',
    method: 'PUT',
    params: params
  })
}

// 教研收藏/取消收藏
export function collectTeachingResearch(params) {
  return request({
    url: '/teachingResearch/collect',
    method: 'post',
    params: params
  })
}

// 教研报告收藏/取消收藏报告
export function collectReport(params) {
  return request({
    url: '/teachingResearch/collectReport',
    method: 'post',
    params: params
  })
}

// 根据活动ID获取报名人数
export function enroll(params) {
  return request({
    url: '/activity/getEnroll',
    method: 'post',
    data: params
  })
}
// 报名审核
export function enrollAudit(params) {
  return request({
    url:'/activity/enrollAudit',
    method: 'post',
    params
  })
}

// 获取参与者列表
export function getParticipantItemPage(params) {
  return request({
    url: '/activity/getParticipantItemPage',
    method: 'post',
    data: params
  })
}

//新增教研评价
export function saveEvaluate(params) {
  return request({
    url: '/teachingResearch/saveEvaluate',
    method: 'post',
    data: params
  })
}
